home *** CD-ROM | disk | FTP | other *** search
- /* $Header: Xutil.h,v 11.39 87/09/12 02:32:45 rws Exp $ */
-
- /*
- *****************************************************************************
- ** *
- ** COPYRIGHT (c) 1988 BY *
- ** DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. *
- ** ALL RIGHTS RESERVED *
- ** *
- ** THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED *
- ** ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE *
- ** INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER *
- ** COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY *
- ** OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY *
- ** TRANSFERRED. *
- ** *
- ** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE *
- ** AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT *
- ** CORPORATION. *
- ** *
- ** DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS *
- ** SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. *
- ** *
- *****************************************************************************
- **++
- ** FACILITY:
- **
- ** < to be supplied >
- **
- ** ABSTRACT:
- **
- ** < to be supplied >
- **
- ** ENVIRONMENT:
- **
- ** < to be supplied >
- **
- ** MODIFICATION HISTORY:
- **
- ** < to be supplied >
- **
- **--
- **/
-
- #ifndef _XUTIL_H_
- #define _XUTIL_H_
-
- /*
- * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding
- * value (x, y, width, height) was found in the parsed string.
- */
- #define NoValue 0x0000
- #define XValue 0x0001
- #define YValue 0x0002
- #define WidthValue 0x0004
- #define HeightValue 0x0008
- #define AllValues 0x000F
- #define XNegative 0x0010
- #define YNegative 0x0020
-
- typedef struct {
- long flags; /* marks which fields in this structure are defined */
- int x, y;
- int width, height;
- int min_width, min_height;
- int max_width, max_height;
- int width_inc, height_inc;
- struct {
- int x; /* numerator */
- int y; /* denominator */
- } min_aspect, max_aspect;
- } XSizeHints;
-
- /*
- * The next block of definitions are for window manager properties that
- * clients and applications use for communication.
- */
-
- /* flags argument in size hints */
- #define USPosition (1L << 0) /* user specified x, y */
- #define USSize (1L << 1) /* user specified width, height */
-
- #define PPosition (1L << 2) /* program specified position */
- #define PSize (1L << 3) /* program specified size */
- #define PMinSize (1L << 4) /* program specified minimum size */
- #define PMaxSize (1L << 5) /* program specified maximum size */
- #define PResizeInc (1L << 6) /* program specified resize increments */
- #define PAspect (1L << 7) /* program specified min and max aspect ratios */
- #define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect)
-
- typedef struct {
- long flags; /* marks which fields in this structure are defined */
- Bool input; /* does this application rely on the window manager to
- get keyboard input? */
- int initial_state; /* see below */
- Pixmap icon_pixmap; /* pixmap to be used as icon */
- Window icon_window; /* window to be used as icon */
- int icon_x, icon_y; /* initial position of icon */
- Pixmap icon_mask; /* icon mask bitmap */
- XID window_group; /* id of related window group */
- /* this structure may be extended in the future */
- } XWMHints;
-
- /* definition for flags of XWMHints */
-
- #define InputHint (1L << 0)
- #define StateHint (1L << 1)
- #define IconPixmapHint (1L << 2)
- #define IconWindowHint (1L << 3)
- #define IconPositionHint (1L << 4)
- #define IconMaskHint (1L << 5)
- #define WindowGroupHint (1L << 6)
- #define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint| \
- IconPositionHint|IconMaskHint|WindowGroupHint)
-
- /* definitions for initial window state */
-
- #define DontCareState 0 /* don't know or care */
- #define NormalState 1 /* most applications want to start this way */
- #define ZoomState 2 /* application wants to start zoomed */
- #define IconicState 3 /* application wants to start as an icon */
- #define InactiveState 4 /* application believes it is seldom used; some
- wm's may put it on inactive menu */
-
-
- typedef struct {
- int min_width, min_height;
- int max_width, max_height;
- int width_inc, height_inc;
- } XIconSize;
-
- typedef struct {
- char *res_name;
- char *res_class;
- } XClassHint;
-
- /*
- * These macros are used to give some sugar to the image routines so that
- * naive people are more comfortable with them.
- */
- #define XDestroyImage(ximage) \
- ((*((ximage)->f.destroy_image))((ximage)))
- #define XGetPixel(ximage, x, y) \
- ((*((ximage)->f.get_pixel))((ximage), (x), (y)))
- #define XPutPixel(ximage, x, y, pixel) \
- ((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel)))
- #define XSubImage(ximage, x, y, width, height) \
- ((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height)))
- #define XAddPixel(ximage, value) \
- ((*((ximage)->f.add_pixel))((ximage), (value)))
-
- /*
- * Compose sequence status structure, used in calling XLookupString.
- */
- typedef struct _XComposeStatus {
- char *compose_ptr; /* state table pointer */
- int chars_matched; /* match state */
- } XComposeStatus;
-
- /*
- * Keysym macros, used on Keysyms to test for classes of symbols
- */
- #define IsKeypadKey(keysym) \
- (((unsigned)(keysym) >= XK_KP_Space) && ((unsigned)(keysym) <= XK_KP_Equal))
-
- #define IsCursorKey(keysym) \
- (((unsigned)(keysym) >= XK_Home) && ((unsigned)(keysym) < XK_Select))
-
- #define IsPFKey(keysym) \
- (((unsigned)(keysym) >= XK_KP_F1) && ((unsigned)(keysym) <= XK_KP_F4))
-
- #define IsFunctionKey(keysym) \
- (((unsigned)(keysym) >= XK_F1) && ((unsigned)(keysym) <= XK_F35))
-
- #define IsMiscFunctionKey(keysym) \
- (((unsigned)(keysym) >= XK_Select) && ((unsigned)(keysym) < XK_KP_Space))
-
- #define IsModifierKey(keysym) \
- (((unsigned)(keysym) >= XK_Shift_L) && ((unsigned)(keysym) <= XK_Hyper_R))
-
- /*
- * opaque reference to Region data type
- */
- typedef struct _XRegion *Region;
-
- /* Return values from XRectInRegion() */
-
- #define RectangleOut 0
- #define RectangleIn 1
- #define RectanglePart 2
-
- /*
- * Information used by the visual utility routines to find desired visual
- * type from the many visuals a display may support.
- */
-
- typedef struct {
- Visual *visual;
- VisualID visualid;
- int screen;
- int depth;
- int class;
- unsigned long red_mask;
- unsigned long green_mask;
- unsigned long blue_mask;
- int colormap_size;
- int bits_per_rgb;
- } XVisualInfo;
-
- #define VisualNoMask 0x0
- #define VisualIDMask 0x1
- #define VisualScreenMask 0x2
- #define VisualDepthMask 0x4
- #define VisualClassMask 0x8
- #define VisualRedMaskMask 0x10
- #define VisualGreenMaskMask 0x20
- #define VisualBlueMaskMask 0x40
- #define VisualColormapSizeMask 0x80
- #define VisualBitsPerRGBMask 0x100
- #define VisualAllMask 0x1FF
-
- /*
- * This defines a window manager property that clients may use to
- * share standard color maps:
- */
-
- typedef struct {
- Colormap colormap;
- unsigned long red_max;
- unsigned long red_mult;
- unsigned long green_max;
- unsigned long green_mult;
- unsigned long blue_max;
- unsigned long blue_mult;
- unsigned long base_pixel;
- } XStandardColormap;
-
- /*
- * return codes for XReadBitmapFile and XWriteBitmapFile
- */
- #define BitmapSuccess 0
- #define BitmapOpenFailed 1
- #define BitmapFileInvalid 2
- #define BitmapNoMemory 3
- /*
- * Declare the routines that don't return int.
- */
-
- /****************************************************************
- *
- * Context Management
- *
- ****************************************************************/
-
-
- /* Associative lookup table return codes */
-
- #define XCSUCCESS 0 /* No error. */
- #define XCNOMEM 1 /* Out of memory */
- #define XCNOENT 2 /* No entry in table */
-
- typedef int XContext;
-
- #define XUniqueContext() ((XContext) XrmUniqueQuark())
- #define XAtomToContext(atom) ((XContext) XrmAtomToQuark(atom))
-
- extern int XSaveContext(); /* window, context, data */
- /* Window window; */
- /* XContext context; */
- /* caddr_t data; */
-
- extern int XFindContext(); /* display, window, context, data */
- /* Display *display; */
- /* Window window; */
- /* XContext context; */
- /* caddr_t *data; RETURN */
-
- extern int XDeleteContext(); /* window, context */
- /* Window window; */
- /* XContext context; */
-
-
- XWMHints *XGetWMHints();
- Region XCreateRegion(), XPolygonRegion();
- XImage *XCreateImage();
-
- XVisualInfo *XGetVisualInfo();
- #endif /* _XUTIL_H_ */
-